<?php
if (!defined("_INDEX")) { header("Location: /"); die; }

if (!isset($_FILES['file']))
	die;

$path_name = MAIN_DIR.DS."files".DS."img".DS."news".DS."tmp";
$photo_size = getimagesize($_FILES['file']['tmp_name']);
$photo_name = "x_".time().".".substr(strrchr($_FILES['file']['name'], '.'), 1);
resizeImg($_FILES['file']['tmp_name'],$photo_size[0],$photo_size[1],$path_name.DS.$photo_name);
echo "/files/img/news/tmp/".$photo_name;
?>
